<%@ include file="/common/taglibs.jsp"%>
<head>
    <title><fmt:message key="userProfile.title"/></title>
    <script type="text/javascript" src="<c:url value='/scripts/selectbox.js'/>"></script>
</head>

<link href="${ctx}/ext/styles/validator/cmxform.css" rel="stylesheet"
	type="text/css">
<script language="javascript" type="text/javascript"
		src="${ctx}/ext/scripts/validator/jquery.validate.js">
	</script>
	<script language="javascript" type="text/javascript"
		src="${ctx}/ext/scripts/validator/validateUtil.js">
	</script>
<script type="text/javascript">
jQuery.validator.setDefaults( {
	submitHandler : function() {
		document.userForm.submit;
	}
});

jQuery().ready(function() {
		jQuery("#roleForm").validate({
			rules:{
				authoriyname:{
					required: true
				},
				description:{
					required: true
				}
			},
			messages:{
				authoriyname:{
					required: "<fmt:message key="validate.authoriyname.nul"/>"
				},
				description:{
					required: "<fmt:message key="validate.description.nul"/>"
				}
			}
		});
	});
</script>
<div class="box_big">
<form:form commandName="authoriy" method="post" action="authoriyform.html" id="roleForm">
<form:hidden path="authoriyid"/>
<div class="bj_biao">
	<h4>
		<fmt:message key="authoriy.baseheader"/>:
	</h4>
</div>
<table border="0" cellspacing="0" cellpadding="0" class="table_cx2">
	<tr height="18"></tr>
	<tr>
		<th width="200">
			<fmt:message key="authoriy.name"/><span class="required">*</span>:
		</th>
		<td width="460">
			<c:if test="${param.method eq 'Add'}">
				<form:input path="authoriyname" id="name" cssClass="text"/>
			</c:if>
			<c:if test="${param.method ne 'Add'}">
				<form:input path="authoriyname" id="name" cssClass="text" readonly="true"/>
			</c:if>
		</td>
	</tr>
	<tr>
		<th>
			<fmt:message key="authoriy.description"/><span class="required">*</span>:
		</th>
		<td>
			<form:input path="description" id="description" cssClass="text"/>
		</td>
	</tr>
	<tr>
		<th>
			<fmt:message key="authoriy.parentid"/><span class="required">*</span>:
		</th>
		<td>
			<form:select path="parentid" cssClass="text4">
				<option value=""><fmt:message key="common.pleaseselect"/></option>
				<c:forEach var="s" items="${pauthoriylist}">
					<form:option value="${s.authoriyid}">${s.description}</form:option>
				</c:forEach>
			</form:select>
		</td>
	</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" class="table_bj">
	<tr>
		<td align="left">
			<input type="submit" class="btn_blue2" name="save" value="<fmt:message key="button.save"/>"/>
        	<input type="button" class="btn_blue2" name="cancel" value="<fmt:message key="button.cancel"/>" onclick="onCancel()"/>
		</td>
	</tr>
</table>
<input type="hidden" name="from" value="<c:out value="${param.from}"/>"/>
<input type="hidden" name="method" value="<c:out value="${param.method}"/>"/> 
</form:form>
</div>
<script type="text/javascript">
function onCancel()
{
	window.location.href="${ctx}/user/authoriyform.html?method=query";
}
</script>


